home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / lcsrc.arc / CRT_GETX.ASM < prev    next >
Assembly Source File  |  1985-04-03  |  1KB  |  58 lines

  1. ;-----------------------------------------------------------------------
  2. ;
  3. ; name        crt_getxy -- get current cursor setting
  4. ;
  5. ; synopsis    int    crt_getxy(page)
  6. ;            int     page;
  7. ;  
  8. ; description    returns the current cursor setting in page # "page".
  9. ;        In text mode, it is possible to have up to 8 different 
  10. ;        pages, all with different cursor settings. 
  11. ;
  12. ; example    rc = crt_getxy(0);
  13. ;        column =  rc & 0xff;    /* col is lower byte        */
  14. ;        row    =  rc >> 8;    /* row is upper byte          */
  15. ;                    /* an interesting alternative    */
  16. ;                    /* to the above: row=rc % 0x100    */
  17. ;
  18. ;----------------------------------------------------------------------
  19.  
  20.     include    dos.mac
  21.  
  22. video    equ    10h        ; video interrupt number
  23.  
  24.     IF    LPROG
  25. X    EQU    6        ;OFFSET OF ARGUMENTS
  26.     ELSE
  27. X    EQU    4        ;OFFSET OF ARGUMENTS
  28.     ENDIF
  29.  
  30.     PSEG
  31.  
  32.     PUBLIC    crt_getxy
  33.  
  34.     IF    LPROG
  35. crt_getxy    PROC    FAR
  36.     ELSE
  37. crt_getxy    PROC    NEAR
  38.     ENDIF
  39.  
  40.     push    bp
  41.     mov    bp,sp
  42.     mov    bh,[bp+x]        ; get the page # into bh
  43.     mov    ah,3
  44.     int    video
  45.     mov    ax,dx            ; return ( 256*row + col )
  46.     pop    bp
  47.     ret
  48.  
  49. crt_getxy    endp
  50.  
  51.  
  52.     ENDPS    
  53.     END
  54.  
  55.  
  56.  
  57.  
  58.